package org.shop.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.shop.dao.QuestionMapper;
import org.shop.entity.Question;
import org.shop.service.QuestionService;
import org.shop.service.base.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class QuestionServiceImpl extends BaseServiceImpl<Question, Long> implements QuestionService{
	
	@Autowired
	private QuestionMapper questionMapper;
	
	public List<Map<String, Object>> getQuestionList(Map<String, Object> params){
		return questionMapper.getQuestionList(params);
	}
	
	public Map<String, Object> getQuestionDetails(Map<String, Object> params){
		return questionMapper.getQuestionDetails(params);
	}

	@Override
	public Map<String, Object> getQuestionInfoList(Map<String, Object> paramMap) {
		List<Map<String, Object>> questionInfoList = questionMapper.getQuestionInfoList(paramMap);
        Integer count = questionMapper.getQuestionInfoCount(paramMap);
        //分页数据
        Map<String, Object> dataMap = new HashMap<String, Object>();
        dataMap.put("total", count);
        dataMap.put("rows", questionInfoList);
        return dataMap;
	}
	
}